package service.impl;

import bean.User;
import dao.impl.UserDaoImpl;
import service.UserService;
import util.SysEnum;

import java.sql.SQLException;

/**
 * 系统用户业务逻辑实现类
 */
public class UserServiceImpl implements UserService{

    private UserDaoImpl userDao = new UserDaoImpl();

    @Override
    public int regexLoginInfo(String username,String password,int role) throws SQLException {

        User findUser = userDao.findUserByInfo(username,password,role);
        if(findUser != null){
            //校验成功
            return SysEnum.SUCCESS.code;
        }else {
            return SysEnum.USER_NOT_FIND.code;
        }
    }
}

